//
// Created by ken on 8/29/22.
//

#ifndef WI_FI_PARTY_ANDROID_AUDIOENGINE_H
#define WI_FI_PARTY_ANDROID_AUDIOENGINE_H

#include <aaudio/AAudio.h>
#include "libwifiparty/libwifiparty.hpp"
#include "party-protocol/party-protocol.hpp"
#include "Oscillator.h"

class AudioEngine {
public:
    AudioEngine();
    bool startPlaying();
    bool startRecording();
    void stopPlaying();
    void stopRecording();
    void restartPlaying();
    void restartRecording();
    Channel *vocal_channel, *music_channel;
    Receiver *receiver;
    Mixer<Trackreceiver> *trackMixer;
    Trackreceiver *musicTrack, *vocalTrack;
    Oscillator *o;


private:
    AAudioStream *playStream;
    AAudioStream *recordStream;
};

enum channel_ids{
    music=1,
    vocal=2
};


#endif //WI_FI_PARTY_ANDROID_AUDIOENGINE_H
